﻿using System;
using LatoolNet;

namespace NumericalSolution {
  class MatrixDemoMain {
    static void Main() {

      Matrix mat = new Matrix(3, 3);
      Matrix vec = new Matrix(3, 1);

      mat[0, 0] = 8;
      mat[0, 1] = -1;
      mat[0, 2] = -4;
      mat[1, 0] = -4;
      mat[1, 1] = 1;
      mat[1, 2] = 4;
      mat[2, 0] = -9;
      mat[2, 1] = -6;
      mat[2, 2] = 4;

      vec[0, 0] = -6;
      vec[1, 0] = 10;
      vec[2, 0] = -9;

      //LUFactorization.Solve(mat, vec);
      LinearEquation.Solve(mat, vec);

      Console.WriteLine(vec.ToString());

      mat.Dispose();
      vec.Dispose();
    }
  }
}
